package com.dingpeikeji.quickdeer.core.modules.sys.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dingpeikeji.quickdeer.core.common.persistence.Page;
import com.dingpeikeji.quickdeer.core.common.service.CrudService;
import com.dingpeikeji.quickdeer.core.modules.sys.dao.SysAdsDao;
import com.dingpeikeji.quickdeer.core.modules.sys.entity.SysAds;

/**
 * 广告管理Service
 * @author 
 * @version 2016-11-11
 */
@Service
@Transactional(readOnly = true)
public class SysAdsService extends CrudService<SysAdsDao,SysAds> {

	public SysAds get(String id) {
		return super.get(id);
	}
	
	public List<SysAds> findList(SysAds sysAds) {
		return super.findList(sysAds);
	}
	
	public Page<SysAds> findPage(Page<SysAds> page, SysAds sysAds) {
		return super.findPage(page, sysAds);
	}
	
	@Transactional(readOnly = false)
	public void save(SysAds sysAds) {
		if(sysAds.getAid()==null){
			dao.insert(sysAds);
		} else {
			dao.update(sysAds);
		}
	}
	
	@Transactional(readOnly = false)
	public void delete(SysAds sysAds) {
		super.delete(sysAds);
	}
	
	@Transactional(readOnly = false)
	public void getAds(SysAds sysAds) {
		
	}
	public List<SysAds> getBannerImage() {
		return dao.getBannerImage();
	}
	
}